{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Class discussion --\n",
    "\n",
    "Q - How does random forest deal with outliers?  \n",
    "A - In general they are resilient about random outliers as they will be no split occuring for a few outlier observations. For consistent outliers, it will give a consisent signal how dependent variable is dependent on some outlier value.  \n",
    "\n",
    "Q - Which score is used for classification problem like R^sq for regression?  \n",
    "A - For classification use **cross entropy/ loss loss**  \n",
    "\n",
    "Q - Creating an appropriate **test set** is the most important. Why?  \n",
    "A - If test set is good indicator of how well your model will work in production, . This is something you will keep in mind even after getting promoted to high position, even if you don't do hands on coding. Wrong test set can lead to heavy loss in business in real world. \n",
    "\n",
    "Use sequential (e.g. last 3 months) of data as test set for time related data (e.g. grocery)\n",
    "Think like what, how and when are you trying to predict\n",
    "\n",
    "Q - Regarding point above, we may not have data related to time in our observation, but our data might be dependent on time. How to do train-validate split then? What should our test set look like?   \n",
    "A - Think of type of problem at hand. \n",
    "\n",
    "Q - How to deal with seasonality if we take validation and test just last few months?\n",
    "A - think what factors lead to have seasonality. why is sales higher in summers? what factor impact that?\n",
    "\n",
    "Q - Is OOB score better or worse estimator for model as compared to validation set score?  \n",
    "A - Generally worse because OOB only saw subset of trees and training data saw full forest.\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Waterfall chart\n",
    "Widely used in business (don't use python, would be cool if someone can make it. Not that difficult thought)\n",
    "\n",
    "#### Tree interpretor\n",
    "Can be used to debug why some prediction came out to be bad. (e.g. Jeremy like Citizen Kane)  \n",
    "\n",
    "-------\n",
    "Comparing test/ validation set with training set. (is_valid flag)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### My questions --  \n",
    "\n",
    "Q - Again, what is bias?  \n",
    "A - ? -- Maybe difference between prediction and average of all y's (easiest guess)\n",
    "\n",
    "Q - How is particular feature come out most important for one row, different for other row?\n",
    "A - ?\n",
    "\n",
    "Q - About PDP, why only 1 point in 1960 (not 500 lines). Learn more about what is there on Y axis.\n",
    "A\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Random Forest from scratch -- \n",
    "Will compare it with sklearn random forest to see how well we did\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### HW\n",
    "* Try to replicate whatever we learnt in class today for some kaggle problem or any other dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
